package com.mini.gateway.core.modules.route.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mini.gateway.core.modules.route.enums.ParamType;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Predicate
 *
 */
@Data
@NoArgsConstructor
@TableName("tb_route_param")
public class RouteParam {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @TableField("route_id")
    private Integer routeId;

    @TableField("param_type")
    private ParamType paramType;

    @TableField("param_name")
    private String name;

    @TableField("args")
    private Map<String, String> args = new LinkedHashMap<>();

    public void addArgs(String key, String value) {
        args.put(key, value);
    }
}
